package com.wut.clock.elasticsearch.dto;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author ZYH
 * @unit D9Lab
 * @description 文章信息
 * @date 2022/6/20 10:47
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Document(indexName = "article",replicas = 0)
public class ArticleParam implements Serializable {

    private static final long serialVersionUID = -1L;

    /**
     * 主键
     */
    @Id
    private Integer id;

    /**
     * 专栏id
     */
    private Integer categoryId;

    /**
     * 专栏名
     */
    @Field(type = FieldType.Keyword)
    private String categoryName;

    /**
     * 文章标题
     */
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String articleTitle;

    /**
     * 文章内容
     */
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String articleContent;

    /**
     * 文章关键词
     */
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String keywords;

    /**
     * 文章URL
     */
    private String articleUrl;

    /**
     * 文章分数
     */
    private BigDecimal score;
}
